<extend name="Shops:layout" />
<block name="content">
<style type="text/css">
#preview{border:1px solid #cccccc; background:#CCC;color:#fff; padding:5px; display:none; position:absolute;}
</style>
<script>
$(document).ready(function(){
    $('.imgPreview').imagePreview();
    <notempty name='shopCatId1'>
    getShopCatListForGoods('{$shopCatId1}','{$shopCatId2}');
    </notempty>
});

function change(val){
	if(val == 'username'){
		$('#query').val('');
		$('#query').attr('placeholder','请输入用户名');
	}else if(val == 'ordersn'){
		$('#query').val('');
		$('#query').attr('placeholder','请输入订单号');
	}else{
		$('#query').val('');
		$('#query').attr('placeholder','请输入用户名/订单号');
	}
}

</script>
<style type="text/css">
tr{height:40px;line-height:40px}
.dingdan_content{width:650px;border:1px solid #d5dfe8;background:#eef3f7;float:left; padding:20px;}
.dingdan_content li{ float:left;width:310px;}
.dingdan_content_user{width:650px;border:1px solid #d5dfe8;background:#eef3f7;float:left; padding:20px;}
.dingdan_content_user li{ line-height:25px;}

.api_b{width:80px; display:inline-block;font-weight:normal}
.yun_ma{ word-break:break-all; width:199px; background:#fff; overflow:auto; height:100px; border:5px solid #09F; padding:5px;}
</style>
    <div class="wst-body"> 
       <div class='wst-page-header'>卖家中心 > 商品管理</div>
	   <div class='wst-page-content' style="margin:10px 0;">
	   
		<div class="dingdan_content">
			<h3 style="clear:both;display:block; line-height:30px;"><?php echo $shop['title']; ?></h3>			
			<li><b class="api_b">剩余次数：</b><?php echo $shop['shenyurenshu']; ?> 人次	</li>		
			<li><b class="api_b">总需次数：</b><?php echo $shop['zongrenshu']; ?>人次 	</li>		
			<li><b class="api_b">商品期数：</b>第 <?php echo $shop['qishu']; ?> 期	</li>
			<li><b class="api_b">商品价格：</b><?php echo $shop['money'];?>	</li>
			<li><b class="api_b"><font color="#ff0000">中奖人</font></b><?php echo $record['username']; ?></li>
			<li><b class="api_b"><font color="#ff0000">中奖抢购码</font></b><?php echo $record['huode']; ?></li>	
			<div class="bk10"></div>
			<li><b class="api_b">购买次数：</b><?php echo $record['gonumber']; ?>人次</li>
			<li class="yun_ma" style="width:309px;"><b class="api_b">获得抢购码：</b><br/>			
			<?php  
				$record['goucode'] = str_ireplace($record[huode],"<font color='red'>$record[huode]</font>",$record['goucode']);
				echo str_ireplace(',',"&nbsp;&nbsp;&nbsp;&nbsp;",$record['goucode']);
			?>
            </li>	
			</li>
		</div>
		<div class="bk10"></div>
			
		<div class="dingdan_content_user">
			<li><b class="api_b">购买人ID：</b> <?php echo $user['userId'];?></li>
			<li><b class="api_b">购买人昵称：</b> <?php echo $user['userName'];?></li>
			<li><b class="api_b">购买人邮箱：</b><?php echo $user['userEmail'];?></li>		
			<li><b class="api_b">购买人手机：</b><?php echo $user['userPhone'];?></li>					
			<li><b class="api_b">购买时间：</b><?php echo date("Y-m-d H:i:s",$go_time);?></li>	
            <li><b class="api_b">收货信息：</b><?php 
			if($record['address']){
			echo $record['address'];
			}else{
			if($user_dizhi){
				$sheng = M('areas')->where(array('areaId' => $user_dizhi['areaId1']))->getField('areaName');
				$shi = M('areas')->where(array('areaId' => $user_dizhi['areaId2']))->getField('areaName');
				$xian = M('areas')->where(array('areaId' => $user_dizhi['areaId3']))->getField('areaName');
				echo $sheng.' - '.$shi.' - '.$xian.' - '.$user_dizhi['address'];
				echo "&nbsp;&nbsp;&nbsp;邮编:".$user_dizhi['postCode'];				
				echo "&nbsp;&nbsp;&nbsp;收货人:".$user_dizhi['userName'];
				echo "&nbsp;&nbsp;&nbsp;手机:".$user_dizhi['userPhone'];
			}else{
				echo "该用户未填写收货信息,请自行联系买家！";
			}
			}
			?></li>			
		</div>			
		<div class="bk10"></div>
        <?php 
			if($record['huode']){			
		?>
        
		<div class="dingdan_content_user">
			<?php $status=explode(",",$record['status']); ?>
			<form action="" method="post">
			<input type="hidden" name="code" value="<?php echo $record['id']; ?>"/>
			<li><b class="api_b">购买方式:</b> <font color="#0c0"><?php echo $record['pay_type']; ?>付款</font></li>
			<li><b class="api_b">当前状态:</b> <font color="#0c0"><?php echo $record['status']; ?></font></li>		
			<li><b class="api_b">订单状态:</b><select name="status">
											<option value="<?php echo $status[2]; ?>"><?php echo $status[2]; ?></option>
											<option value="未发货">未发货</option>
											<option value="已发货">已发货</option>
											<option value="已完成">已完成</option>
											<option value="已作废">已作废</option>										
										  </select>
			</li>
			<li><b class="api_b">物流公司:</b>
				<select name="company">
				<?php if($record['company']){ ?>
					<option value="<?php echo $record['company'];?>"><?php echo $record['company'];?></option>
					<?php }else{ ?>
					<option value="">请选择物流公司</option>
					<?php }?>
					<option value="申通快递">申通快递</option>
					<option value="圆通快递">圆通快递</option>
					<option value="中通快递">中通快递</option>
					<option value="顺丰快递">顺丰快递</option>
					<option value="韵达快递">韵达快递</option>
					<option value="天天快递">天天快递</option>
					<option value="百世快递">百世快递</option>		
					<option value="ems">EMS</option>								
				</select>
			</li>
			<li><b class="api_b">快递单号:</b><input type="text" name="company_code" value="<?php echo $record['company_code']; ?>" class="input-text wid150"> 填写物流公司快递单号</li>
			<li><b class="api_b">快递运费:</b><input type="text" name="company_money" value="<?php echo $record['company_money']; ?>"  class="input-text wid150"> 元 </li>
			
			<li><input type="submit" class="button" value="  更新  " name="submit" /></li>		
			</form>
		</div>
        <?php } ?>
	   
       
        </div>
    </div>
</block> 